import { S } from '../../s';
import { PSControlImpl } from '../pscontrol-impl';
import { IPSDEToolbar } from './ipsdetoolbar';
import { IPSDEToolbarItem } from './ipsdetoolbar-item';

export class PSDEToolbarImpl extends PSControlImpl implements IPSDEToolbar {
  get owner(): IModel {
    return this.M.owner;
  }

  protected psdetoolbaritems: IPSDEToolbarItem[];
  getPSDEToolbarItems(): IPSDEToolbarItem[] | null {
    return (
      this.psdetoolbaritems ||
      (this.psdetoolbaritems = this.fillChildListModel(
        this.M.getPSDEToolbarItems,
        S._1a1,
      ) as IPSDEToolbarItem[])
    );
  }

  findPSDEToolbarItem(objKey: any): IPSDEToolbarItem | null {
    return this.getPSModel5(
      S._1a1,
      this.getPSDEToolbarItems(),
      objKey,
    ) as IPSDEToolbarItem;
  }

  get toolbarStyle(): string {
    return this.M.toolbarStyle;
  }

  get xDataControlName(): string {
    return this.M.xDataControlName;
  }
  get cls(): string {
    return 'PSDEToolbarImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._260) return true;
    return super.instanceof(cls);
  }
}
